<template>
  <div class="blanklayout">
    <router-view v-slot="{ Component }">
      <keep-alive :include="keepAliveRoutes">
        <component :is="Component"/>
      </keep-alive>
    </router-view>
  </div>
</template>

<script>
import {reactive, toRefs} from "vue";
import utils from "@/common/utils/utils";
import routes from "@/router/router.config";

export default {
  name: "BlankLayout",
  setup(props, {emit}) {
    const state = reactive({
      keepAliveRoutes: [],
    });

    const init = () => {
      utils.getKeepAliveRoutes(routes, state.keepAliveRoutes);
    };
    init();

    return {
      ...toRefs(state),
    }
  },
};
</script>

<style lang="less" scoped>
.blanklayout {
  width: 100%;
  height: 100%;
}
</style>
